using System.Collections;
using System.Xml.Serialization;

namespace AreaBuilder {
    [XmlRoot(ElementName = "area")]
    public class Area {
        private ArrayList helpList = new ArrayList();
        private ArrayList itemList = new ArrayList();
        private ArrayList mobList = new ArrayList();
        private ArrayList progList = new ArrayList();
        private ArrayList resetList = new ArrayList();
        private ArrayList roomList = new ArrayList();
        private ArrayList shopList = new ArrayList();
        private ArrayList specList = new ArrayList();

        [XmlElement(ElementName = "file")]
        public string File { get; set; }

        [XmlElement(ElementName = "title")]
        public string Title { get; set; }

        [XmlElement(ElementName = "author")]
        public string Author { get; set; }

        [XmlElement(ElementName = "minLevel")]
        public int MinLevel { get; set; }

        [XmlElement(ElementName = "maxLevel")]
        public int MaxLevel { get; set; }

        [XmlElement(ElementName = "minVnum")]
        public int MinVnum { get; set; }

        [XmlElement(ElementName = "maxVnum")]
        public int MaxVnum { get; set; }


        [XmlArray("helps")]
        [XmlArrayItem("help", typeof (Help))]
        public ArrayList Helps {
            get { return helpList; }
            set { helpList = value; }
        }

        [XmlArray("mobs")]
        [XmlArrayItem("mob", typeof (Mobile))]
        public ArrayList Mobs {
            get { return mobList; }
            set { mobList = value; }
        }

        [XmlArray("mobProgs")]
        [XmlArrayItem("prog", typeof (MobProg))]
        public ArrayList Progs {
            get { return progList; }
            set { progList = value; }
        }

        [XmlArray("items")]
        [XmlArrayItem("item", typeof (Item))]
        public ArrayList Items {
            get { return itemList; }
            set { itemList = value; }
        }

        [XmlArray("rooms")]
        [XmlArrayItem("room", typeof (Room))]
        public ArrayList Rooms {
            get { return roomList; }
            set { roomList = value; }
        }

        [XmlArray("resets")]
        [XmlArrayItem("reset", typeof (Reset))]
        public ArrayList Resets {
            get { return resetList; }
            set { resetList = value; }
        }

        [XmlArray("shops")]
        [XmlArrayItem("shop", typeof (Shop))]
        public ArrayList Shops {
            get { return shopList; }
            set { shopList = value; }
        }

        [XmlArray("specials")]
        [XmlArrayItem("special", typeof (Special))]
        public ArrayList Specials {
            get { return specList; }
            set { specList = value; }
        }

        public void AddMob(Mobile m) {
            mobList.Add(m);

            //Console.WriteLine("Added mob: {0}", m.Name);
        }

        public void AddProg(MobProg mp) {
            progList.Add(mp);

            //Console.WriteLine("Added mobprog: {0}", mp.VNum);
        }

        public void AddItem(Item i) {
            itemList.Add(i);

            //Console.WriteLine("Added item: {0}", i.VNum);
        }

        public void AddReset(Reset r) {
            resetList.Add(r);

            //Console.WriteLine("Added reset: {0}", r.Type);
        }

        public void AddSpecial(Special s) {
            specList.Add(s);

            //Console.WriteLine("Added special: {0}", s.Type);
        }

        public void AddShop(Shop s) {
            shopList.Add(s);

            //Console.WriteLine("Added shop: {0}", s.VNum);
        }

        public void AddRoom(Room r) {
            roomList.Add(r);

            //Console.WriteLine("Added room: {0}", r.VNum);
        }

        public void AddHelp(Help h) {
            helpList.Add(h);

            //Console.WriteLine("Added help: {0}", h.Keywords);
        }
    }
}